package com.object;


import com.object.configuration.utils.IdsUtil;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;

import java.util.ArrayList;
import java.util.List;

@SpringBootTest
public class PQ {
    @Value("${spike.shop.name}")
    private String spikeName;
    @Autowired
    private RedisTemplate<String, Object> redisTemplate;
    @Value("${spike.shop.start.name}")
    private String SpikeStartName;
    @Test
    void test(){
        //{"alipay_trade_query_response":{"code":"10000","msg":"Success","buyer_logon_id":"trq***@sandbox.com","buyer_pay_amount":"0.00","buyer_user_id":"2088102181546853","buyer_user_type":"PRIVATE","invoice_amount":"0.00","out_trade_no":"0bfb75a47c184dd7a22aabd293aad421","point_amount":"0.00","receipt_amount":"0.00","total_amount":"100.00","trade_no":"2022030222001446850501748819","trade_status":"WAIT_BUYER_PAY"},"sign":"X1S8JuRaq+h1oHsPlXzX9xDgEZcpEvPtfxKkNEglf9vuW/GR5uky/romm4st5b5xJAU4aJdZ0WW4wVIAMywmoUEWlxZMJ/Q2JRo6j6GEpjQ6QOnRGkx5gbp+eVIKIEQiJw0BtDuy1PiLrThK54h1D/LVVE7ijBuR2qaR1LWTqD/0dCXDfgTRg8P5yYpJqfZ6MT0dxnJKBvP3iyVQFlLmOzX2d4l2YFOa4vfEVjS4D5nlau223K0Ejz6tY7p40FSMKMu6eUSrgC+zl7lojiiMGmEVR4Ha1FO70Owkbv75Kd8PyBbyWsC+j/Wje96tOtfUPnlmKdPDl2Agh+4pxl3hgg=="}
        //{"alipay_trade_query_response":{"code":"40004","msg":"Business Failed","sub_code":"ACQ.TRADE_NOT_EXIST","sub_msg":"交易不存在","buyer_pay_amount":"0.00","invoice_amount":"0.00","out_trade_no":"786f57fa99444d0bae6263e898d88856","point_amount":"0.00","receipt_amount":"0.00"},"sign":"UjHrO6TuLmWmwd6rYOnANgjm8CNWvyLC9UAUrmrdfGyKCZBPnd/CWQKnjDcT7cQ6VlVGzQ6tNnj+9DSg8INa+KgQIPr4TH8sHDI4AjBLQr1jAkYOsvIMo9qYTGRIkSCNHdMaseN2cqF1PzQzf66Ed3F5zsgNXThMDpO8b5VBD35JvA5d3EWucckYgg3Zjfdug7fcOveDmj8AyqaxgQuqZepynhWVRvZp1obzuqug/jdx0a7GpqTNPB1AXmhJfiSLfb9zWn+Skdca/ZugMYkS2p7zo2QlRw7LJlttEIpt6Jn9OqDl+Crts6eq0vTrTul7FfX6/1MfDJdxFwNw5C53hw=="}
//      /{"alipay_trade_query_response":{"code":"10000","msg":"Success","buyer_logon_id":"trq***@sandbox.com","buyer_pay_amount":"300.00","buyer_user_id":"2088102181546853","buyer_user_type":"PRIVATE","fund_bill_list":[{"amount":"300.00","fund_channel":"ALIPAYACCOUNT"}],"invoice_amount":"300.00","out_trade_no":"b6c057e0976b402fb5f6d65b2af840da","point_amount":"0.00","receipt_amount":"300.00","send_pay_date":"2022-03-02 16:45:53","total_amount":"300.00","trade_no":"2022030222001446850501748941","trade_status":"TRADE_SUCCESS"},"sign":"OHmOErrTfh8Jc0BOfVzpHBLVAH9lq8wtvhysxBdrTDOABUbuK2RqjeUdykoHbI4BTL25pwtx20TvOJK2KFwNdMgjYTMFPITUrIC7apiL+K1VO1nkscBepU916etKtiekUm18LTHaFDFS+mvf9TpjZEUF1Z9nM1oezYjXS7zp1QDeooz4MVtR/ltKa21P0hRgqkehm5r07wmPWYg4x8U9UJ/nu401DHL9KEedwworIgsL11wH6nT/vc9ph//yK9O8DoZNB4hcRm1hZ5XXHUJNiFFPkHdaSwj1DW85wr1DBUoUr0BwRbXX/5NVoXu22KcVH6rTAs4x5un2sJp1LQUo/g=="}
        //PayUtile.getPay(UUID.randomUUID().toString(), 0.01, "测试商品", 10000);
    /*    Double af840da = PayUtile.getPaymentSuccess("5e3481788413466282437be9f75c2b11");
        System.out.println(af840da);*/
        List<Integer> list=new ArrayList<>();
        list.add(1);
        list.add(2);
        redisTemplate.opsForValue().set(SpikeStartName+list.get(0),10);
        redisTemplate.opsForValue().set(SpikeStartName+list.get(1),10);
        String data = IdsUtil.toString(list.toString());
        System.out.println(data);
         redisTemplate.opsForValue().set(spikeName,data);
    }


    @Value("${lq.test.name}")
    private String namel;
    @Test
    void ss()
    {
        System.out.println(namel);
    }

}
